package com.twt.Dao;

import com.twt.entity.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper //标记mapper文件位置，否则在Application.class启动类上配置mapper包扫描
@Repository
public interface MessageDao {
    void insertMessage(@Param("bottleId") int bottleId,
                       @Param("sendUserName") String sendUserName,
                       @Param("Message") String Message,
                       @Param("Time") String Time);

    List<Message> getName(@Param("bottleId")int bottleId);

    void setNewMessageInPickTrue(@Param("bottleId")int bottleId, @Param("username")String username);

    void setNewMessageInThrowTrue(@Param("bottleId")int bottleId, @Param("username")String username);

    void setNewMessageInPickFalse(@Param("bottleId")int bottleId, @Param("username")String username);

    void setNewMessageInThrowFalse(@Param("bottleId")int bottleId, @Param("username")String username);

    void setUserNonexistentInThrowedByBottleId(@Param("bottleId")int bottleId, @Param("username")String username);

    void setUserNonexistentInPickedByBottleId(@Param("bottleId")int bottleId, @Param("username")String username);

    void setTopInThrowed(@Param("bottleId")int bottleId, @Param("username")String username,@Param("top")int top);

    void setTopInPicked(@Param("bottleId")int bottleId, @Param("username")String username,@Param("top")int top);
}
